package com.jinzhi.jzweb.controller;


import java.math.BigDecimal;
import java.util.*;
import java.util.stream.Collectors;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.jinzhi.common.utils.StringUtil;
import com.jinzhi.jzapi.examination.pojo.ExaminationsVo;
import com.jinzhi.jzweb.domain.*;
import com.jinzhi.jzweb.pojo.*;
import com.jinzhi.jzweb.pojo.ModuleConfig.JzJinzhuanDispositionTopic;
import com.jinzhi.jzweb.pojo.ModuleConfig.StatisticsVO;
import com.jinzhi.jzweb.service.*;
import com.jinzhi.jzweb.service.moduleConfig.IJzJinzhuanDispositionTopicService;
import com.jinzhi.jzweb.utils.EasyPoiUtil;
import com.jinzhi.sys.domain.UserDO;
import com.jinzhi.sys.service.UserService;
import org.apache.poi.ss.formula.functions.T;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.ui.Model;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.jinzhi.common.base.BaseController;
import com.jinzhi.common.utils.Result;

import javax.servlet.http.HttpServletResponse;

/**
 * 
 * <pre>
 * 打分表
 * </pre>
 * <small> 2023-06-19 08:45:15 | lance</small>
 */
@RestController
@RequestMapping("/jzweb/markA")
public class MarkAController extends BaseController {

	@Autowired
	private MarkService markService;

	@Autowired
	private ExaminationBatchService examinationBatchService;


	@Autowired
	private ExaminationBatchComService examinationBatchComService;

	@Autowired
	private IJzJinzhuanDispositionTopicService  jzJinzhuanDispositionTopicService;


	@Autowired
	private StuSignUpComService stuSignUpService;


	/**
	 * 查询考试批次
	 * @return
	 */
	@ResponseBody
	@GetMapping("/selEbatchId")
	public Result<List<ExaminationBatchDO>> selEbatchId(String competitionType) {
		EntityWrapper wrapper =new EntityWrapper();
		if (Objects.nonNull(competitionType)  && !competitionType.equals(null) && !competitionType.equals("null") && !competitionType.equals("")){
			wrapper.addFilter("{0} like CONCAT('%',competition_type,'%')",competitionType);
		}
		wrapper.eq("type",3); //查询实操批次
		wrapper.orderBy("id",true);
		List<ExaminationBatchDO> examinationBatchDOList = examinationBatchService.selectList(wrapper);
		return Result.ok(examinationBatchDOList);
	}




	/**
	 * 分数统计导出
	 * competition A赛场
	 * ebatchId 考试批次
	 * cbatchId 认证批次
	 * @return
	 */
	@ResponseBody
	@GetMapping("/scoreStatisticsexcel")
	public Result scoreStatisticsexcel(String competition,String competitionType, String ebatchId, String cbatchId, HttpServletResponse response){
		ArrayList<Long>	stuIds	=	new ArrayList<>();
		//导出的数据
		List<Map<Object,Object>> excelList = new ArrayList<>();
		List<ScoreAStatisticsexcel> excel = new ArrayList<>();
		List<ScoreAOneStatisticsexcel> excelOne = new ArrayList<>();
		List<ScoreATwoStatisticsexcel> excelTwo = new ArrayList<>();
		List<ScoreAThreeStatisticsexcel> excelThree = new ArrayList<>();
		List<ScoreAFourStatisticsexcel> excelFour = new ArrayList<>();
		List<ScoreAFiveStatisticsexcel> excelFive = new ArrayList<>();
		ScoreOneStatisticsexcel scoreOneStatisticsexcelex = new ScoreOneStatisticsexcel();
		// 查询列表数据
		//查询理论赛场的学员
		Map stuMap =new HashMap();
		stuMap.put("competition",competition);
		stuMap.put("ebatchId",ebatchId);
		stuMap.put("cbatchId",cbatchId);
		List<StuSignUpComDO> stuList = stuSignUpService.ListUstLiLuASCExcel(stuMap);
		if (stuList.size() <= 0){
			EasyPoiUtil.exportExcel(excel, "A赛场成绩导出",  "A赛场成绩导出", ScoreAStatisticsexcel.class, "A赛场成绩导出", response);
			return Result.ok("没有可导出的数据");
		}
		for (int i = 0; i < stuList.size(); i++ ){
			if (stuList.get(i) == null || stuList.get(i).getId() == null){
				stuList.remove(stuList.get(i));
			}
		}
		//拿出考试id
		for (int i = 0 ;i < stuList.size(); i++){
			//考生id
			stuIds.add(stuList.get(i).getId());
		}
		//查询裁判个数(用于表头)
		Map map =new HashMap();
		map.put("competition",competition); //根据赛场查询 abc必填
		map.put("cbatchId",cbatchId);
		map.put("ebatchId",ebatchId);
		List<MrkRefereeVO> mrkRefereeVOS = markService.selectRefereeSize(map);
//		for (int i = 0 ;i < mrkRefereeVOS.size();i++){
//			statisticsVO.setRefereeVOList(new ArrayList<>());
//			statisticsVO.getRefereeVOList().add(mrkRefereeVOS.get(i));
//		}
		//查询出对应学员的裁判打分数据
		map.put("signId",stuIds);
		map.put("status",0);//0代表是理论考试的实操题（案例分析题）
		StatisticsVO statisticsVO = new StatisticsVO();
		List<MarkVO> markVOS = markService.selectAListScore(map);
		//查询出对应学员理论机考的成绩
		map.put("status",1);//0代表是理论考试的机考题（自动打分，数据库中是每个人一条数据）
		List<MarkVO> markStatusVOS = markService.selectAListStatusScore(map);
		MarkVO markVO = new MarkVO();
		//循环打分数据进行学员id匹配
		for (int i = 0; i < stuList.size(); i++) {
			ScoreAOneStatisticsexcel scoreAOneStatisticsexcel = new ScoreAOneStatisticsexcel();
			ScoreATwoStatisticsexcel scoreATwoStatisticsexcel = new ScoreATwoStatisticsexcel();
			ScoreAThreeStatisticsexcel scoreAThreeStatisticsexcel = new ScoreAThreeStatisticsexcel();
			ScoreAFourStatisticsexcel scoreAFourStatisticsexcel = new ScoreAFourStatisticsexcel();
			ScoreAFiveStatisticsexcel scoreAFiveStatisticsexcel = new ScoreAFiveStatisticsexcel();
			ScoreAStatisticsexcel scoreStatisticsexcel = new ScoreAStatisticsexcel();
			ArrayList<MarkVO>	MarkVO	=	new ArrayList<>();
			for (int j = 0; j < markVOS.size(); j++) {
				if(Objects.equals(stuList.get(i).getId(),markVOS.get(j).getSignId())){
					stuList.get(i).setMarkVO(new ArrayList<>());
					stuList.get(i).getMarkVO().add(markVOS.get(j));
					markVOS.get(j).setRefereeScore(String.valueOf(markVOS.get(j).getUpdateScore()));
					MarkVO.add(markVOS.get(j));
				}
			}
			stuList.get(i).setMarkVO(MarkVO);
			if (mrkRefereeVOS != null && mrkRefereeVOS.size() > 0){//说明有裁判
				if ( stuList.get(i).getMarkVO().size() < mrkRefereeVOS.size()){//说明没有裁判给他打分
					markVO.setJudgment(1);
					markVO.setRefereeScore("-");
					MarkVO.add(markVO);//加一个裁判分
				}
			}
			if (stuList.get(i).getMarkVO() != null && stuList.get(i).getMarkVO().size() > 0 &&  stuList.get(i).getMarkVO().get(0).getJudgment() != 1){
				//统计总得分
				BigDecimal TotalScore = new BigDecimal(0);
				for (int j = 0; j< stuList.get(i).getMarkVO().size();j++){//这个学员的所有裁判打的安全防护分
					if (stuList.get(i).getMarkVO().get(j).getUpdateScore() != 0.0){
						TotalScore = new BigDecimal(stuList.get(i).getMarkVO().get(j).getUpdateScore()).add(TotalScore);//得到所有裁判打的总分
					}
				}
				BigDecimal size = new BigDecimal(stuList.get(i).getMarkVO().stream().filter(a -> Objects.nonNull(a.getMakId())).count());
				if((BigDecimal.ZERO).compareTo(size) == 0 ){
					size = new BigDecimal(1);
				}
				//学员得的案例分析的总分
				BigDecimal totalScore = TotalScore.divide(size,2, BigDecimal.ROUND_HALF_UP);//divide是除以
				//最终学员这个任务所获得的总分
				//循环学员的机考分数
				Double computerScore = 0.0;
				for (int j = 0; j < markStatusVOS.size(); j++){
					//判断学员id是否相等，相等就说明是一个学员的分数
					if (markStatusVOS.get(j).getSignId().equals(stuList.get(i).getId())){
						//将分数拿出来，这是A赛场机考的分数
						if(StringUtil.notEmpty(competitionType) && competitionType.equals("1"))
							computerScore =markStatusVOS.get(j).getUpdateScore() * 0.12;
						else if(StringUtil.notEmpty(competitionType) && competitionType.equals("2") ||
								competitionType.equals("3")){
							computerScore = markStatusVOS.get(j).getUpdateScore() * 0.3;
						}

						//将机考的分数存入返回值，因为前端需要循环所以放到总分字段那一层去
						BigDecimal computerScores = new BigDecimal(computerScore);
						stuList.get(i).setComputerScore(computerScores.setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue());
					}
				}
				BigDecimal computerScores = new BigDecimal(computerScore);
				System.out.println("机考分："+computerScores);
				System.out.println("裁判分："+totalScore);
				//学员得的案例分析的总分
				BigDecimal computerScoresz = computerScores.setScale(2, BigDecimal.ROUND_HALF_UP);//divide是除以
				stuList.get(i).setTotalScore(new BigDecimal((totalScore.doubleValue()) + (computerScoresz.doubleValue())).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue());//最终得分为每个裁判打的总分除以裁判人数 ，加上机考的分数
//				stuList.get(i).setTotalScore((totalScore.doubleValue() * 0.6) + (computerScore * 0.4));//最终得分为每个裁判打的总分除以裁判人数 ，加上机考的分数
			}
			if (competitionType.equals("1")){
				if (!stuList.get(i).getMarkVO().isEmpty() && stuList.get(i).getMarkVO().get(0).getJudgment() == 1){//说明案例分析题集合没数据
					//计算学员机考的分数
					//循环学员的机考分数
					Double computerScore = 0.0;
					for (int j = 0; j < markStatusVOS.size(); j++){
						//判断学员id是否相等，相等就说明是一个学员的分数
						if (markStatusVOS.get(j).getSignId().equals(stuList.get(i).getId())){
							//将分数拿出来
							computerScore = markStatusVOS.get(j).getUpdateScore()*0.12;
							//将机考的分数存入返回值，因为前端需要循环所以放到总分字段那一层去
							stuList.get(i).setComputerScore(computerScore);
						}
					}
					BigDecimal computerScores = new BigDecimal(computerScore);
					BigDecimal computerScoresz = computerScores.setScale(2, BigDecimal.ROUND_HALF_UP);//divide是除以
					stuList.get(i).setTotalScore(computerScoresz.doubleValue()+stuList.get(i).getTotalScore());//最终得分为每个裁判打的总分除以裁判人数 ，加上机考的分数
				}else if (stuList.get(i).getMarkVO() != null && stuList.get(i).getMarkVO().size() <= 0){//说明没有还没有裁判开始打分
					//计算学员机考的分数
					//循环学员的机考分数
					Double computerScore = 0.0;
					for (int j = 0; j < markStatusVOS.size(); j++) {
						//判断学员id是否相等，相等就说明是一个学员的分数
						if (markStatusVOS.get(j).getSignId().equals(stuList.get(i).getId())) {
							//将分数拿出来
							computerScore = markStatusVOS.get(j).getUpdateScore()*0.12;
							//将机考的分数存入返回值，因为前端需要循环所以放到总分字段那一层去
							stuList.get(i).setComputerScore(computerScore);
						}
					}
					BigDecimal computerScores = new BigDecimal(computerScore);
					//学员得的案例分析的总分
					BigDecimal computerScoresz = computerScores.setScale(2, BigDecimal.ROUND_HALF_UP);//divide是除以
					stuList.get(i).setTotalScore(computerScoresz.multiply(new BigDecimal(0.4)).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue());//最终得分为每个裁判打的总分除以裁判人数 ，加上机考的分数
				}
			}else if (competitionType.equals("2") || competitionType.equals("3")){//学生组
				//计算学员机考的分数
				//循环学员的机考分数
				Double computerScore = 0.0;
				for (int j = 0; j < markStatusVOS.size(); j++){
					//判断学员id是否相等，相等就说明是一个学员的分数
					if (markStatusVOS.get(j).getSignId().equals(stuList.get(i).getId())){
						//将分数拿出来
						computerScore = markStatusVOS.get(j).getUpdateScore()*0.3;
						//将机考的分数存入返回值，因为前端需要循环所以放到总分字段那一层去
						stuList.get(i).setComputerScore(computerScore);
					}
				}
				stuList.get(i).setTotalScore(computerScore);//最终得分为每个裁判打的总分除以裁判人数 ，加上机考的分数
			}



				//如果裁判数量为0那就是没有裁判就是学生组
			if (mrkRefereeVOS.size() <= 0 && stuList.get(i).getMarkVO() == null){
					scoreStatisticsexcel.setNum1(String.valueOf(stuList.get(i).getNum1()));
					scoreStatisticsexcel.setNum2(String.valueOf(stuList.get(i).getNum2()));
					scoreStatisticsexcel.setUnitName(stuList.get(i).getUnitName());
					scoreStatisticsexcel.setName(stuList.get(i).getName());
					scoreStatisticsexcel.setIdNumber(stuList.get(i).getIdNumber());
					scoreStatisticsexcel.setTotalScore(stuList.get(i).getTotalScore());
					BigDecimal computerScores = new BigDecimal(stuList.get(i).getComputerScore());
					BigDecimal computerScoresl =  computerScores.setScale(2,BigDecimal.ROUND_HALF_UP);
					scoreStatisticsexcel.setComputerScore(computerScoresl.doubleValue());
				}
			if (mrkRefereeVOS.size() <= 0 && stuList.get(i).getMarkVO() != null && stuList.get(i).getMarkVO().size() <= 0){
				scoreStatisticsexcel.setNum1(String.valueOf(stuList.get(i).getNum1()));
				scoreStatisticsexcel.setNum2(String.valueOf(stuList.get(i).getNum2()));
				scoreStatisticsexcel.setUnitName(stuList.get(i).getUnitName());
				scoreStatisticsexcel.setName(stuList.get(i).getName());
				scoreStatisticsexcel.setIdNumber(stuList.get(i).getIdNumber());
				scoreStatisticsexcel.setTotalScore(stuList.get(i).getTotalScore());
				BigDecimal computerScores = new BigDecimal(stuList.get(i).getComputerScore());
				BigDecimal computerScoresl =  computerScores.setScale(2,BigDecimal.ROUND_HALF_UP);
				scoreStatisticsexcel.setComputerScore(computerScoresl.doubleValue());
			}

				//循环
				//一个裁判
				if (mrkRefereeVOS.size() == 1 ){
					if (stuList.get(i).getMarkVO() == null){
						//将考生信息存入导出类中
						scoreAOneStatisticsexcel.setNum1(String.valueOf(stuList.get(i).getNum1()));
						scoreAOneStatisticsexcel.setNum2(String.valueOf(stuList.get(i).getNum2()));
						scoreAOneStatisticsexcel.setUnitName(stuList.get(i).getUnitName());
						scoreAOneStatisticsexcel.setName(stuList.get(i).getName());
						scoreAOneStatisticsexcel.setIdNumber(stuList.get(i).getIdNumber());
						BigDecimal computerScores = new BigDecimal(stuList.get(i).getComputerScore());
						BigDecimal computerScoresl =  computerScores.setScale(2,BigDecimal.ROUND_HALF_UP);
						scoreAOneStatisticsexcel.setComputerScore(computerScoresl.doubleValue());
						scoreAOneStatisticsexcel.setTotalScore(stuList.get(i).getTotalScore());
					}else {
					for (int p = 0;p < stuList.get(i).getMarkVO().size();p++){
						if (p == 0){
							scoreAOneStatisticsexcel.setRefeereOneScore(stuList.get(i).getMarkVO().get(p).getRefereeScore());
						}
						//将考生信息存入导出类中
						scoreAOneStatisticsexcel.setNum1(String.valueOf(stuList.get(i).getNum1()));
						scoreAOneStatisticsexcel.setNum2(String.valueOf(stuList.get(i).getNum2()));
						scoreAOneStatisticsexcel.setUnitName(stuList.get(i).getUnitName());
						scoreAOneStatisticsexcel.setName(stuList.get(i).getName());
						scoreAOneStatisticsexcel.setIdNumber(stuList.get(i).getIdNumber());
						BigDecimal computerScores = new BigDecimal(stuList.get(i).getComputerScore());
						BigDecimal computerScoresl =  computerScores.setScale(2,BigDecimal.ROUND_HALF_UP);
						scoreAOneStatisticsexcel.setComputerScore(computerScoresl.doubleValue());
						scoreAOneStatisticsexcel.setTotalScore(stuList.get(i).getTotalScore());
					}
					}
				}
				//两个裁判
				if (mrkRefereeVOS.size() == 2 ){
					if (stuList.get(i).getMarkVO() == null){
						//将考生信息存入导出类中
						scoreATwoStatisticsexcel.setNum1(String.valueOf(stuList.get(i).getNum1()));
						scoreATwoStatisticsexcel.setNum2(String.valueOf(stuList.get(i).getNum2()));
						scoreATwoStatisticsexcel.setUnitName(stuList.get(i).getUnitName());
						scoreATwoStatisticsexcel.setName(stuList.get(i).getName());
						scoreATwoStatisticsexcel.setIdNumber(stuList.get(i).getIdNumber());
						BigDecimal computerScores = new BigDecimal(stuList.get(i).getComputerScore());
						BigDecimal computerScoresl =  computerScores.setScale(2,BigDecimal.ROUND_HALF_UP);
						scoreATwoStatisticsexcel.setComputerScore(computerScoresl.doubleValue());
						scoreATwoStatisticsexcel.setTotalScore(stuList.get(i).getTotalScore());
					}else {
						for (int p = 0; p < stuList.get(i).getMarkVO().size(); p++) {
							if (p == 0) {
								scoreATwoStatisticsexcel.setRefeereOneScore(stuList.get(i).getMarkVO().get(p).getRefereeScore());
							} else if (p == 1) {
								scoreATwoStatisticsexcel.setRefeereTwoScore(stuList.get(i).getMarkVO().get(p).getRefereeScore());
							}
							//将考生信息存入导出类中
							scoreATwoStatisticsexcel.setNum1(String.valueOf(stuList.get(i).getNum1()));
							scoreATwoStatisticsexcel.setNum2(String.valueOf(stuList.get(i).getNum2()));
							scoreATwoStatisticsexcel.setUnitName(stuList.get(i).getUnitName());
							scoreATwoStatisticsexcel.setName(stuList.get(i).getName());
							scoreATwoStatisticsexcel.setIdNumber(stuList.get(i).getIdNumber());
							BigDecimal computerScores = new BigDecimal(stuList.get(i).getComputerScore());
							BigDecimal computerScoresl =  computerScores.setScale(2,BigDecimal.ROUND_HALF_UP);
							scoreATwoStatisticsexcel.setComputerScore(computerScoresl.doubleValue());
							scoreATwoStatisticsexcel.setTotalScore(stuList.get(i).getTotalScore());
						}
					}
				}
				//三个裁判
				if (mrkRefereeVOS.size() == 3 ){
					if (stuList.get(i).getMarkVO() == null){
						//将考生信息存入导出类中
						scoreATwoStatisticsexcel.setNum1(String.valueOf(stuList.get(i).getNum1()));
						scoreATwoStatisticsexcel.setNum2(String.valueOf(stuList.get(i).getNum2()));
						scoreATwoStatisticsexcel.setUnitName(stuList.get(i).getUnitName());
						scoreATwoStatisticsexcel.setName(stuList.get(i).getName());
						scoreATwoStatisticsexcel.setIdNumber(stuList.get(i).getIdNumber());
						BigDecimal computerScores = new BigDecimal(stuList.get(i).getComputerScore());
						BigDecimal computerScoresl =  computerScores.setScale(2,BigDecimal.ROUND_HALF_UP);
						scoreATwoStatisticsexcel.setComputerScore(computerScoresl.doubleValue());
						scoreATwoStatisticsexcel.setTotalScore(stuList.get(i).getTotalScore());
					}else {
						for (int p = 0; p < stuList.get(i).getMarkVO().size(); p++) {
							if (p == 0) {
								scoreAThreeStatisticsexcel.setRefeereOneScore(stuList.get(i).getMarkVO().get(p).getRefereeScore());
							} else if (p == 1) {
								scoreAThreeStatisticsexcel.setRefeereTwoScore(stuList.get(i).getMarkVO().get(p).getRefereeScore());
							} else if (p == 2) {
								scoreAThreeStatisticsexcel.setRefeereThreeScore(stuList.get(i).getMarkVO().get(p).getRefereeScore());
							}
						}
						scoreAThreeStatisticsexcel.setNum1(String.valueOf(stuList.get(i).getNum1()));
						scoreAThreeStatisticsexcel.setNum2(String.valueOf(stuList.get(i).getNum2()));
						scoreAThreeStatisticsexcel.setUnitName(stuList.get(i).getUnitName());
						scoreAThreeStatisticsexcel.setName(stuList.get(i).getName());
						scoreAThreeStatisticsexcel.setIdNumber(stuList.get(i).getIdNumber());
						BigDecimal computerScores = new BigDecimal(stuList.get(i).getComputerScore());
						BigDecimal computerScoresl =  computerScores.setScale(2,BigDecimal.ROUND_HALF_UP);
						scoreAThreeStatisticsexcel.setComputerScore(computerScoresl.doubleValue());
						scoreAThreeStatisticsexcel.setTotalScore(stuList.get(i).getTotalScore());
					}
				}
				//四个裁判
				if (mrkRefereeVOS.size() == 4 ){
					if (stuList.get(i).getMarkVO() == null){
						//将考生信息存入导出类中
						scoreATwoStatisticsexcel.setNum1(String.valueOf(stuList.get(i).getNum1()));
						scoreATwoStatisticsexcel.setNum2(String.valueOf(stuList.get(i).getNum2()));
						scoreATwoStatisticsexcel.setUnitName(stuList.get(i).getUnitName());
						scoreATwoStatisticsexcel.setName(stuList.get(i).getName());
						scoreATwoStatisticsexcel.setIdNumber(stuList.get(i).getIdNumber());
						BigDecimal computerScores = new BigDecimal(stuList.get(i).getComputerScore());
						BigDecimal computerScoresl =  computerScores.setScale(2,BigDecimal.ROUND_HALF_UP);
						scoreATwoStatisticsexcel.setComputerScore(computerScoresl.doubleValue());
						scoreATwoStatisticsexcel.setTotalScore(stuList.get(i).getTotalScore());
					}else {
						for (int p = 0; p < stuList.get(i).getMarkVO().size(); p++) {
							if (p == 0) {
								scoreAFourStatisticsexcel.setRefeereOneScore(stuList.get(i).getMarkVO().get(p).getRefereeScore());
							} else if (p == 1) {
								scoreAFourStatisticsexcel.setRefeereTwoScore(stuList.get(i).getMarkVO().get(p).getRefereeScore());
							} else if (p == 2) {
								scoreAFourStatisticsexcel.setRefeereThreeScore(stuList.get(i).getMarkVO().get(p).getRefereeScore());
							} else if (p == 3) {
								scoreAFourStatisticsexcel.setRefeereFourScore(stuList.get(i).getMarkVO().get(p).getRefereeScore());
							}
						}
						scoreAThreeStatisticsexcel.setNum1(String.valueOf(stuList.get(i).getNum1()));
						scoreAThreeStatisticsexcel.setNum2(String.valueOf(stuList.get(i).getNum2()));
						scoreAThreeStatisticsexcel.setUnitName(stuList.get(i).getUnitName());
						scoreAThreeStatisticsexcel.setName(stuList.get(i).getName());
						scoreAThreeStatisticsexcel.setIdNumber(stuList.get(i).getIdNumber());
						BigDecimal computerScores = new BigDecimal(stuList.get(i).getComputerScore());
						BigDecimal computerScoresl =  computerScores.setScale(2,BigDecimal.ROUND_HALF_UP);
						scoreAThreeStatisticsexcel.setComputerScore(computerScoresl.doubleValue());
						scoreAThreeStatisticsexcel.setTotalScore(stuList.get(i).getTotalScore());
					}
				}
				//五个裁判
				if (mrkRefereeVOS.size() == 5) {
					if (stuList.get(i).getMarkVO() == null) {
						//将考生信息存入导出类中
						scoreATwoStatisticsexcel.setNum1(String.valueOf(stuList.get(i).getNum1()));
						scoreATwoStatisticsexcel.setNum2(String.valueOf(stuList.get(i).getNum2()));
						scoreATwoStatisticsexcel.setUnitName(stuList.get(i).getUnitName());
						scoreATwoStatisticsexcel.setName(stuList.get(i).getName());
						scoreATwoStatisticsexcel.setIdNumber(stuList.get(i).getIdNumber());
						BigDecimal computerScores = new BigDecimal(stuList.get(i).getComputerScore());
						BigDecimal computerScoresl =  computerScores.setScale(2,BigDecimal.ROUND_HALF_UP);
						scoreATwoStatisticsexcel.setComputerScore(computerScoresl.doubleValue());
						scoreATwoStatisticsexcel.setTotalScore(stuList.get(i).getTotalScore());
					} else {
						for (int p = 0; p < stuList.get(i).getMarkVO().size(); p++) {
							if (p == 0) {
								scoreAFiveStatisticsexcel.setRefeereOneScore(stuList.get(i).getMarkVO().get(p).getRefereeScore());
							} else if (p == 1) {
								scoreAFiveStatisticsexcel.setRefeereTwoScore(stuList.get(i).getMarkVO().get(p).getRefereeScore());
							} else if (p == 2) {
								scoreAFiveStatisticsexcel.setRefeereThreeScore(stuList.get(i).getMarkVO().get(p).getRefereeScore());
							} else if (p == 3) {
								scoreAFiveStatisticsexcel.setRefeereFourScore(stuList.get(i).getMarkVO().get(p).getRefereeScore());
							} else if (p == 4) {
								scoreAFiveStatisticsexcel.setRefeereFiveScore(stuList.get(i).getMarkVO().get(p).getRefereeScore());
							}
						}
						scoreAThreeStatisticsexcel.setNum1(String.valueOf(stuList.get(i).getNum1()));
						scoreAThreeStatisticsexcel.setNum2(String.valueOf(stuList.get(i).getNum2()));
						scoreAThreeStatisticsexcel.setUnitName(stuList.get(i).getUnitName());
						scoreAThreeStatisticsexcel.setName(stuList.get(i).getName());
						scoreAThreeStatisticsexcel.setIdNumber(stuList.get(i).getIdNumber());
						BigDecimal computerScores = new BigDecimal(stuList.get(i).getComputerScore());
						BigDecimal computerScoresl =  computerScores.setScale(2,BigDecimal.ROUND_HALF_UP);
						scoreAThreeStatisticsexcel.setComputerScore(computerScoresl.doubleValue());
						scoreAThreeStatisticsexcel.setTotalScore(stuList.get(i).getTotalScore());
					}
				}
				excel.add(scoreStatisticsexcel);
				excelOne.add(scoreAOneStatisticsexcel);
				excelTwo.add(scoreATwoStatisticsexcel);
				excelThree.add(scoreAThreeStatisticsexcel);
				excelFour.add(scoreAFourStatisticsexcel);
				excelFive.add(scoreAFiveStatisticsexcel);

		}
		//导出操作
		for (int i = 0;i<stuList.size();i++){
			if (mrkRefereeVOS.size() <=0){
				EasyPoiUtil.exportExcel(excel, "A赛场成绩导出",  "A赛场成绩导出", ScoreAStatisticsexcel.class, "A赛场成绩导出", response);
			}
			if (mrkRefereeVOS.size() == 1){
				EasyPoiUtil.exportExcel(excelOne, "A赛场成绩导出",  "A赛场成绩导出", ScoreAOneStatisticsexcel.class, "A赛场成绩导出", response);
			}else if (mrkRefereeVOS.size() == 2){
				EasyPoiUtil.exportExcel(excelTwo, "A赛场成绩导出",  "A赛场成绩导出", ScoreATwoStatisticsexcel.class, "A赛场成绩导出", response);
			}else if (mrkRefereeVOS.size() == 3){
				EasyPoiUtil.exportExcel(excelThree, "A赛场成绩导出",  "A赛场成绩导出", ScoreAThreeStatisticsexcel.class, "A赛场成绩导出", response);
			}else if (mrkRefereeVOS.size() == 4){
				EasyPoiUtil.exportExcel(excelFour, "A赛场成绩导出",  "A赛场成绩导出", ScoreAFourStatisticsexcel.class, "A赛场成绩导出", response);
			}else if (mrkRefereeVOS.size() == 5){
				EasyPoiUtil.exportExcel(excelFive, "A赛场成绩导出",  "A赛场成绩导出", ScoreAFiveStatisticsexcel.class, "A赛场成绩导出", response);
			}
		}		return Result.ok("导出成功！请勿关闭浏览器,五分钟后浏览！");
	}


//	public static void main(String[] args) {
//		BigDecimal a =new BigDecimal(190);
//		BigDecimal b =new BigDecimal(3);
//		BigDecimal c = a.divide(b,2, BigDecimal.ROUND_HALF_UP);
//		System.out.println(c);
//	}
//


	/**
	 * 分数统计（A赛场成绩统计，主要是案例分析题打分统计）
	 * competition ABC赛场
	 * ebatchId 考试批次
	 * cbatchId 认证批次
	 * @return
	 */
	@ResponseBody
	@PostMapping("/scoreStatistics")
	public Result<?> scoreStatistics(@RequestBody ExaminationsVo examinationsVo){
		ArrayList<Long>	stuIds	=	new ArrayList<>();
		StatisticsVO statisticsVO = new StatisticsVO();
		// 查询列表数据
		Map stuMap =new HashMap();
		stuMap.put("competition",examinationsVo.getCompetition());
		stuMap.put("cbatchId",examinationsVo.getCbatchId());
		stuMap.put("ebatchId",examinationsVo.getEbatchId());
		Page<StuSignUpComDO> stuList = stuSignUpService.ListUstLiLuASC(examinationsVo.getCurrent(), examinationsVo.getNumber(), stuMap);
		if (stuList.getRecords().isEmpty()){
			statisticsVO.setStuSignUpComDO(stuList);
			return Result.ok(statisticsVO);
		}
		for (int i = 0; i < stuList.getRecords().size(); i++ ){
				if (stuList.getRecords().get(i).getId() == null){
					stuList.getRecords().remove(stuList.getRecords().get(i));
				}
		}
		//拿出考试id
		for (int i = 0 ;i < stuList.getRecords().size(); i++){
			//考生id
			stuIds.add(stuList.getRecords().get(i).getId());
		}
		//查询裁判个数(用于表头)
		Map map =new HashMap();
		map.put("competition",examinationsVo.getCompetition()); //根据赛场查询 abc必填
		map.put("cbatchId",examinationsVo.getCbatchId());
		map.put("ebatchId",examinationsVo.getEbatchId());
		List<MrkRefereeVO> mrkRefereeVOS = markService.selectRefereeSize(map);
		ArrayList<MrkRefereeVO>	mrkRefereeVO	=	new ArrayList<>();
		for (int i = 0 ;i < mrkRefereeVOS.size();i++){
			 mrkRefereeVO.add(mrkRefereeVOS.get(i));
		}
		statisticsVO.setRefereeVOList(mrkRefereeVOS);
		//查询出对应学员的裁判打分数据
		map.put("signId",stuIds);
		map.put("status",0);//0代表是理论考试的实操题（案例分析题）
		map.put("cbatchId",examinationsVo.getCbatchId());
		map.put("ebatchId",examinationsVo.getEbatchId());
		List<MarkVO> markVOS = markService.selectAListScore(map);
		//查询出对应学员理论机考的成绩
		//数据库没有status=1的数据
		map.put("status",1);//0代表是理论考试的机考题（自动打分，数据库中是每个人一条数据）
		List<MarkVO> markStatusVOS = markService.selectAListStatusScore(map);
		MarkVO markVO = new MarkVO();
		for (int i = 0; i < stuList.getRecords().size(); i++) {
			ArrayList<MarkVO>	MarkVO	=	new ArrayList<>();
				for (int j = 0; j < markVOS.size(); j++) {
					if(Objects.equals(stuList.getRecords().get(i).getId(),markVOS.get(j).getSignId())){
						markVOS.get(j).setEbatchId(stuList.getRecords().get(i).getEbatchId());
						markVOS.get(j).setSignId(stuList.getRecords().get(i).getSignId());
						markVOS.get(j).setRefereeScore(String.valueOf(markVOS.get(j).getUpdateScore()));
						MarkVO.add(markVOS.get(j));
//						stuList.getRecords().get(i).getMarkVO().add(markVOS.get(j));
					}
				}
			stuList.getRecords().get(i).setMarkVO(MarkVO);
			if (mrkRefereeVOS != null && mrkRefereeVOS.size() > 0){//说明有裁判
					if ( stuList.getRecords().get(i).getMarkVO().size() < mrkRefereeVOS.size()){//说明有裁判没给他打分
						markVO.setJudgment(1);
						markVO.setRefereeScore("-");
						MarkVO.add(markVO);//加一个裁判分
					}
			}
			ExaminationBatchDO examinationBatchDO = Optional.ofNullable(examinationBatchService.selectById(stuList.getRecords().get(i).getEbatchId())).orElse(new ExaminationBatchDO());
			if (stuList.getRecords().get(i).getMarkVO() != null && stuList.getRecords().get(i).getMarkVO().size() > 0 &&  stuList.getRecords().get(i).getMarkVO().get(0).getJudgment() != 1){
				//统计总得分
				BigDecimal TotalScore = new BigDecimal(0);
				for (int j = 0; j< stuList.getRecords().get(i).getMarkVO().size();j++){//这个学员的所有裁判打的安全防护分、
					if (stuList.getRecords().get(i).getMarkVO().get(j).getUpdateScore() != 0.0){
						TotalScore = new BigDecimal(stuList.getRecords().get(i).getMarkVO().get(j).getUpdateScore()).add(TotalScore);//得到所有裁判打的总分
					}
				}
				BigDecimal size = new BigDecimal(stuList.getRecords().get(i).getMarkVO().stream().filter(a -> Objects.nonNull(a.getMakId())).count());
				if((BigDecimal.ZERO).compareTo(size) == 0 ){
					size = new BigDecimal(1);
				}
				//学员得的案例分析的总分
				BigDecimal totalScore = TotalScore.divide(size,2, BigDecimal.ROUND_HALF_UP);//divide是除以
				//最终学员这个任务所获得的总分
				//循环学员的机考分数
				//根据考生id查询批次
				Double computerScore = 0.0;
				for (int j = 0; j < markStatusVOS.size(); j++){
					//判断学员id是否相等，相等就说明是一个学员的分数
					if (markStatusVOS.get(j).getSignId().equals(stuList.getRecords().get(i).getId())){
						//将分数拿出来，这是A赛场机考的分数
						if(StringUtil.notEmpty(examinationBatchDO.getCompetitionType()) && examinationBatchDO.getCompetitionType().equals("1"))
							computerScore =markStatusVOS.get(j).getUpdateScore() * 0.12;
						else if(StringUtil.notEmpty(examinationBatchDO.getCompetitionType()) && examinationBatchDO.getCompetitionType().equals("2") ||
								examinationBatchDO.getCompetitionType().equals("3")){
							computerScore = markStatusVOS.get(j).getUpdateScore() * 0.3;
						}
						//将机考的分数存入返回值，因为前端需要循环所以放到总分字段那一层去
						BigDecimal computerScores = new BigDecimal(computerScore);
						stuList.getRecords().get(i).setComputerScore(computerScores.setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue());
					}
				}
				BigDecimal computerScores = new BigDecimal(computerScore);
				System.out.println("机考分："+computerScores);
				System.out.println("裁判分："+totalScore);
				//学员得的案例分析的总分
				BigDecimal computerScoresz = computerScores.setScale(2, BigDecimal.ROUND_HALF_UP);//divide是除以
				stuList.getRecords().get(i).setTotalScore(new BigDecimal((totalScore.doubleValue()) + (computerScoresz.doubleValue())).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue());//最终得分为每个裁判打的总分除以裁判人数 ，加上机考的分数
			}
			if (examinationsVo.getCompetitionType().equals("1")) {
				if (stuList.getRecords().get(i).getMarkVO() != null && stuList.getRecords().get(i).getMarkVO().size() > 0 &&  stuList.getRecords().get(i).getMarkVO().get(0).getJudgment() == 1) {//说明案例分析题集合没数据，裁判没有打分
					//统计总得分
					BigDecimal TotalScore = new BigDecimal(0);
					for (int j = 0; j< stuList.getRecords().get(i).getMarkVO().size();j++){//这个学员的所有裁判打的安全防护分、
						if (stuList.getRecords().get(i).getMarkVO().get(j).getUpdateScore() != 0.0) {
							stuList.getRecords();
							TotalScore = new BigDecimal(stuList.getRecords().get(i).getMarkVO().get(j).getUpdateScore()).add(TotalScore);//得到所有裁判打的总分
						}
					}
					BigDecimal size = new BigDecimal(stuList.getRecords().get(i).getMarkVO().size());
					//学员得的案例分析的总分
					BigDecimal totalScore = TotalScore.divide(size,2, BigDecimal.ROUND_HALF_UP);//divide是除以
					//计算学员机考的分数
					//循环学员的机考分数
					Double computerScore = 0.0 ;
					for (int j = 0; j < markStatusVOS.size(); j++) {
						//判断学员id是否相等，相等就说明是一个学员的分数
						if (markStatusVOS.get(j).getSignId().equals(stuList.getRecords().get(i).getId())) {
							if(StringUtil.notEmpty(examinationBatchDO.getCompetitionType()) && examinationBatchDO.getCompetitionType().equals("1"))
								computerScore = markStatusVOS.get(j).getUpdateScore() * 0.12;
							else if(StringUtil.notEmpty(examinationBatchDO.getCompetitionType()) && examinationBatchDO.getCompetitionType().equals("2") ||
									examinationBatchDO.getCompetitionType().equals("3")){
								computerScore = markStatusVOS.get(j).getUpdateScore() * 0.3;
							}
							BigDecimal computerScores = new BigDecimal(computerScore);
							stuList.getRecords().get(i).setComputerScore(computerScores.setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue());
						}
					}
					BigDecimal computerScores = new BigDecimal(computerScore);
					//学员得的案例分析的总分
					BigDecimal computerScoresz = computerScores.setScale(2, BigDecimal.ROUND_HALF_UP);//divide是除以
					stuList.getRecords().get(i).setTotalScore(new BigDecimal((totalScore.doubleValue()) + (computerScoresz.doubleValue())).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue());//最终得分为每个裁判打的总分除以裁判人数 ，加上机考的分数
				}else if (stuList.getRecords().get(i).getMarkVO() != null && stuList.getRecords().get(i).getMarkVO().size() <= 0){//说明没有还没有裁判开始打分
					//计算学员机考的分数
					//循环学员的机考分数
					Double computerScore = 0.0;
					for (int j = 0; j < markStatusVOS.size(); j++) {
						//判断学员id是否相等，相等就说明是一个学员的分数
						if (markStatusVOS.get(j).getSignId().equals(stuList.getRecords().get(i).getId())) {
							if(StringUtil.notEmpty(examinationBatchDO.getCompetitionType()) && examinationBatchDO.getCompetitionType().equals("1"))
								computerScore = markStatusVOS.get(j).getUpdateScore() * 0.12;
							else if(StringUtil.notEmpty(examinationBatchDO.getCompetitionType()) && examinationBatchDO.getCompetitionType().equals("2") ||
									examinationBatchDO.getCompetitionType().equals("3")){
								computerScore = markStatusVOS.get(j).getUpdateScore() * 0.3;
							}
							//将机考的分数存入返回值，因为前端需要循环所以放到总分字段那一层去
							BigDecimal computerScores = new BigDecimal(computerScore);
							stuList.getRecords().get(i).setComputerScore(computerScores.setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue());
						}
					}
					BigDecimal computerScores = new BigDecimal(computerScore);
					//学员得的案例分析的总分
					BigDecimal computerScoresz = computerScores.setScale(2, BigDecimal.ROUND_HALF_UP);//divide是除以
					stuList.getRecords().get(i).setTotalScore(computerScoresz.doubleValue());//最终得分为每个裁判打的总分除以裁判人数 ，加上机考的分数
				}
			}else if (examinationsVo.getCompetitionType().equals("2") || examinationsVo.getCompetitionType().equals("3")){//说明案例分析题集合没数据，就是学生组的
						//计算学员机考的分数
						//循环学员的机考分数
						Double computerScore = 0.0;
						for (int j = 0; j < markStatusVOS.size(); j++) {
							//判断学员id是否相等，相等就说明是一个学员的分数
							if (markStatusVOS.get(j).getSignId().equals(stuList.getRecords().get(i).getId())) {
								if(StringUtil.notEmpty(examinationBatchDO.getCompetitionType()) && examinationBatchDO.getCompetitionType().equals("1"))
									computerScore = markStatusVOS.get(j).getUpdateScore() * 0.12;
								else if(StringUtil.notEmpty(examinationBatchDO.getCompetitionType()) && examinationBatchDO.getCompetitionType().equals("2") ||
										examinationBatchDO.getCompetitionType().equals("3")){
									computerScore = markStatusVOS.get(j).getUpdateScore() * 0.3;
								}
								//将机考的分数存入返回值，因为前端需要循环所以放到总分字段那一层去
								BigDecimal computerScores = new BigDecimal(computerScore);
								stuList.getRecords().get(i).setComputerScore(computerScores.setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue());
							}
						}
					BigDecimal computerScores = new BigDecimal(computerScore);
					//学员得的案例分析的总分
					BigDecimal computerScoresz = computerScores.setScale(2, BigDecimal.ROUND_HALF_UP);//divide是除以
					stuList.getRecords().get(i).setTotalScore(computerScoresz.doubleValue());//最终得分为每个裁判打的总分除以裁判人数 ，加上机考的分数
			}

		}
		//赛场人数
		statisticsVO.setStuNumber(stuList.getRecords().size());
		//最高分
		Double maxScore = 0.0;
		for (int i = 0 ;i < stuList.getRecords().size() ; i++){
			if (stuList.getRecords().get(i).getTotalScore() > maxScore){
				maxScore = stuList.getRecords().get(i).getTotalScore();
			}
		}
		BigDecimal maxScores = new BigDecimal(maxScore);
		//学员得的案例分析的总分
		BigDecimal maxScoresz = maxScores.setScale(2, BigDecimal.ROUND_HALF_UP);//divide是除以
		statisticsVO.setMaxScore(maxScoresz.doubleValue());
		//最低分
		Double minScore = 100.0;
		for (int i = 0 ;i < stuList.getRecords().size() ; i++){
			if (stuList.getRecords().get(i).getTotalScore() < minScore){
				minScore = stuList.getRecords().get(i).getTotalScore();
			}else if (minScore == 0.0){
				minScore = 0.0;
			}
		}
		BigDecimal minScores = new BigDecimal(minScore);
		//学员得的案例分析的总分
		BigDecimal minScoresz = minScores.setScale(2, BigDecimal.ROUND_HALF_UP);//divide是除以
		statisticsVO.setMinScore(minScoresz.doubleValue());
		//将用户分数对象存入最终对象里面去
		statisticsVO.setStuSignUpComDO(stuList);
		statisticsVO.setSize(statisticsVO.getStuSignUpComDO().getSize());
		statisticsVO.setTotal(statisticsVO.getStuSignUpComDO().getTotal());
		return Result.ok(statisticsVO);
	}


	//查询学生

	//根据学生id查询分数

	//查裁判数量

	//根据学生id匹配分数
	//计算总分

	//算排名、人数、最高、最低









	/**
	 * 根据考试批次id查询出竞赛类型
	 */
	private int selCompetitionTypeByEbatchId(String ebatchId){
		ExaminationBatchComDO examinationBatchComDO = examinationBatchComService.selectById(ebatchId);
		if (examinationBatchComDO == null){
			return 0;
		}
		return Integer.valueOf(examinationBatchComDO.getCompetitionType());
	}


	/**
	 * 根据题目 id 查出来题目配置的分值
	 */
	private int selTopicByTopicId(String topicId){
		JzJinzhuanDispositionTopic jzJinzhuanDispositionTopic = jzJinzhuanDispositionTopicService.selectById(topicId);
		if (jzJinzhuanDispositionTopic == null){
			return 0;
		}
		return Integer.valueOf(jzJinzhuanDispositionTopic.getScore().toString());
	}





//
//	/**
//	 * 分数统计 最高分 最低分 总人数（A赛场列表页面上面，最高分，最低分，赛场总人数统计）
//	 * competition A赛场
//	 * ebatchId 考试批次
//	 * cbatchId 认证批次
//	 * @return
//	 */
//	@ResponseBody
//	@GetMapping("/getMinMaxStatistics")
//	public Result<Map> getMinMaxStatistics(String competition,String ebatchId,String cbatchId){
//		Map map =new HashMap();
//		map.put("competition",competition); //根据赛场查询 abc必填
//		map.put("ebatchId", cbatchId);
//		List<MarkDO> list = markService.selectListMarkDO(map);
//		Map rstMap =new HashMap();
//		if (list.size() >0 ){
//			Map selRefereeIdMap =new HashMap();
//			selRefereeIdMap.put("ebatchId",cbatchId); //考试批次
//			selRefereeIdMap.put("competition",competition);//赛场
//			List<Double> scoreSun = new ArrayList<>();
//			if (selCompetitionTypeByEbatchId(ebatchId) == 1){
//				scoreSun = markService.selMaxMinScoreA(selRefereeIdMap); //教师组
//			}else {
//				scoreSun = markService.selMaxMinScoreStudent(selRefereeIdMap);//学生组
//			}
//			scoreSun = scoreSun.stream().sorted().collect(Collectors.toList());
//			rstMap.put("number",list.size()); //人数
//			Double min = scoreSun.get(0);
//			min = new BigDecimal(min).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue();//保留小数点后两位
//			rstMap.put("min",min); //最低分
//		 	Double max =  scoreSun.get(scoreSun.size()-1);
//			max = new BigDecimal(max).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue();//保留小数点后两位
//			rstMap.put("max",max);//最高分
//		}else {
//			rstMap.put("number",0); //人数
//			rstMap.put("min",0); //最低分
//			rstMap.put("max",0); //最高分
//		}
//		return Result.ok(rstMap);
//	}







	/**
	 * 编辑分数回显（编辑分数时的数据回显）
	 * competition A赛场
	 * ebatchId 考试批次
	 * cbatchId 认证批次
	 * @return
	 */
	@ResponseBody
	@GetMapping("/selEditData")
	public Result<?> selEditData(String competition,String ebatchId,String cbatchId,String signId){
		Map map =new HashMap();
		map.put("competition",competition); //根据赛场查询 abc必填
		map.put("cbatchId", cbatchId);
		map.put("ebatchId", ebatchId);
		map.put("signId",signId);
		map.put("status",0); //实操
		List<MrkRefereeVO> mrkReferee = markService.selectRefereeId(map); //查询出打分的三个裁判id
		for (int j=0;j<mrkReferee.size();j++){
			Map selMarkVo =new HashMap();
			selMarkVo.put("cbatchId",cbatchId); //考试批次
			selMarkVo.put("ebatchId", ebatchId);
			selMarkVo.put("competition",competition); //赛场
			selMarkVo.put("stuId",signId);//考生id
			selMarkVo.put("status",0); //实操
			List<MarkVO> markVOS = markService.selectListMarkVO(selMarkVo); //查询出第一个裁判打的五个分数
			mrkReferee.get(j).setMarkVO(markVOS);
		}
		return Result.ok(mrkReferee);
	}


	/**
	 * 管理员改分
	 */
	@ResponseBody
	@PostMapping("/conservatorJudgeMark")
	public Result<Object> conservatorJudgeMark(@RequestBody MarkVO  markVO){//String id,Double score,String video,String picture,String  refereeRemark
		    MarkDO markDO = new MarkDO();
			markDO.setId(markVO.getMakId());
			markDO.setScore(markVO.getUpdateScore());
			markDO.setUpdateScore(markVO.getUpdateScore());
			if (StringUtil.notEmpty(markVO.getVideo()) && !markVO.getVideo().equals("null")) {//视频
				markDO.setVideo(markVO.getVideo());
			}
			if (StringUtil.notEmpty(markVO.getPicture()) && !markVO.getPicture().equals("null")) {//图片
				markDO.setPicture(markVO.getPicture());
			}
			markService.updateById(markDO);
		return Result.ok();
	}





}
